const { stringify } = require('s-yaml');

const data = {
  name: 'Jane Doe',
  age: 25,
  address: {
    street: '456 Elm St',
    city: 'Othertown'
  }
};

const yamlString = stringify(data);
console.log(yamlString);
/*
输出:
name: Jane Doe
age: 25
address:
  street: 456 Elm St
  city: Othertown
*/
